<div style="min-height: 300px; padding-bottom: 20px; width: 98%; float: left" class="portlet x12">
	<div class="portlet-header">
		<h4>Danh sách video

		<div class="buttonrow" style="float: right; margin-right: 20px;">
		<a href="<?php echo base_url ();?>admin/gallery/addvideo">
				<input type="button" value="Thêm video" class="btn btn-orange"></a></div>

		</h4>
		</div> <!-- .portlet-header -->

		<table>

		 <!-- them phan header -->
		 <thead>
				<tr>
					<th style="width: 30%;">Tên video</th>
					<th style="width: 50%;">link video</th>
					<th style="width: 5%;">Trang chủ</th>
					<th>Chức năng</th>
				</tr>
			</thead>
		<!-- ket thuc them head -->
		<?php
		  foreach($dulieu_ve_video as $row_video)
		   {
		   $id = $row_video['id'];
		   $base = base_url();
		   echo '<tr>';
		   echo '<td>'.$row_video['ten_dat'].'</td>';
		   echo '<td>'.$row_video['ten_file_video'].'</td>';
		?>
			<td>
				<input type="radio" name="homepage" value="1" <?php if ($row_video['homepage']==1) echo "checked='checked'"; ?> onchange="addHomepage(this,'<?php echo $id; ?>')" />
			</td>

		       <!-- dua button xoa ra -->
				<td>
				<input type="button" value="Xóa video này" class="btn btn-green"
					onclick="del_item('<?php echo $id;?>')">
			    </td>

				<script>
				function del_item(id){
						var store_del = confirm("Xoa video ?");
					if(store_del==true){
						window.location="<?php echo base_url();?>admin/gallery/xoavideo/"+id;
					}else{
						return false;
					}
				}
				</script>

				<!-- ket thuc dua button xoa -->
        <?php
		   echo '</tr>';
		   }
		?>
		</table>
		<style> .btn btn-green{text-decoration:none;} </style>
		<!-- xem video -->
		<!--
	<object type="application/x-shockwave-flash" data="<?php //echo base_url ();?>application/storage/videos/player_flv_maxi.swf" width="320" height="240">
     <param name="movie" value="<?php //echo base_url ();?>application/storage/videos/player_flv_maxi.swf" />
     <param name="FlashVars" value="flv=<?php //echo base_url ();?>application/storage/videos/a.flv" />
     </object>
	    -->
		<!-- end code xem video-->


	<div class="portlet-content">

	</div> <!-- .portlet-content -->
</div>
<script>
function addHomepage(obj,id){
	var value=0;
	if(obj.checked==true){
		value=1;
	}
	$.post(
			"<?php
			echo base_url ();
			?>gallery/admin/gallery/addHomepage",
			{id : id, value : value},						
			function(data){				
			}
		);
}
</script>